<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" import="cz.possoft.explorer.context.*,cz.possoft.explorer.*"%>

<br>
<c:set var="objectContext" value="${requestScope.currentContext}" />
Attributes coming from 
<c:choose>
					<c:when test="${objectContext.clazz.interface}">
						<c:out value="interface" />
					</c:when>
					<c:otherwise>
						<c:out value="class" />
					</c:otherwise>					
</c:choose>	
<b>
	<c:out value="${objectContext.clazz.name}" />
</b>	
<br><br>
<table border="1">
	<tr>
		<th>Attribute name</th>
		<th>Value</th>
		<th>Class</th>		
		<th></th>
	</tr>
	<c:forEach var="fieldContext" items="${objectContext.fieldContextList}">
		<tr>
			<td><c:out value="${fieldContext.fieldName}" /></td>
			<td>
				<c:choose>
					<c:when test="${fieldContext.value == null}">
						<c:out value="null" />
					</c:when>
					<c:otherwise>
						<c:out value="${fieldContext.value}" />
					</c:otherwise>					
				</c:choose>			
			</td>
			<td><c:out value="${fieldContext.clazz.name}" /></td>			
			<%-- TODO: this link should be encoded --%>
			<td><c:if test="${fieldContext.inspectable}"><a href="explorer?fieldName=${fieldContext.fieldName}">inspect</a></c:if></td>
		</tr>
	</c:forEach>
</table>

<br>
<hr>